package com.mayikt.service;

import com.alibaba.fastjson.JSONObject;
import com.mayikt.base.BaseResponse;
import com.mayikt.dto.req.UnionLoginDTO;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Name MemberUnionLoginService
 * @Author 枫火
 * @Date 2021/5/28 7:08
 * @Description
 **/
@Api(tags = "联合登录接口")
public interface MemberUnionLoginService {

    /**
     * 根部不同联合id登录
     *
     * @param unionPublicId
     * @return
     */
    @GetMapping("/unionLogin")
    BaseResponse<String> unionLogin(@RequestParam("unionPublicId") String unionPublicId);

    /**
     * 联合登录回调接口
     *
     * @param unionPublicId
     * @return
     */
    @GetMapping("/login/oauth/callback")
//    public BaseResponse<JSONObject> unionLoginCallback(@RequestParam("unionPublicId") String unionPublicId);
    public String unionLoginCallback(@RequestParam("unionPublicId") String unionPublicId);


    /**
     * 查询当前开通的渠道
     *
     * @return
     */
    @GetMapping("/unionLoginList")
    @ResponseBody
    BaseResponse<List<UnionLoginDTO>> unionLoginList();
}
